package JasPerl::JSTL::Core::ParamParent;

use 5.010;
use strict;
use warnings;

use URI::QueryParam;

sub add_parameter {
    my ($self, $name, $value) = @_;
    my $uri = $self->{uri} or return;
    return unless length $name;

    # newer parameters precede older ones
    my @values = $uri->query_param($name);
    $uri->query_param($name, $value // '', @values);
}

1;
